﻿package com.tudou.home.newskin.buttons
{
    import com.tudou.home.newskin.events.*;
    import com.tudou.skin.*;
    import com.tudou.skin.common.button.*;
    import com.tudou.skin.common.events.*;

    public class FullscreenButton extends BaseButton implements IFullscreen
    {

        public function FullscreenButton()
        {
            addStateButton(new EnterFullscreenBTN());
            addStateButton(new ExitFullscreenBTN());
            addRollOverOut(new RollOverOutSprite(this.width, this.height));
            this.addEventListener(ButtonEvent.CLICK, buttonHlr);
            clickContainer = true;
            activeIndex = 0;
            return;
        }// end function

        public function exitFullscreen() : void
        {
            activeIndex = 0;
            return;
        }// end function

        public function enterFullscreen() : void
        {
            activeIndex = 1;
            return;
        }// end function

        private function buttonHlr(event:ButtonEvent) : void
        {
            var _loc_2:* = event.clickIndex == 0 ? (true) : (false);
            dispatchEvent(new SkinEvent(SkinEvent.SET_FULLSCREEN));
            return;
        }// end function

    }
}
